// 加载vue模块
import Vue from 'vue';
// 加载vue-router路由模块
import VueRouter from 'vue-router';

// 加载、引入组件文件
import Index from '../views/index.vue';
import Home from '../views/home.vue';
import Say from '../views/say.vue'
import My from '../views/my.vue'
import Detail from '../views/detail.vue'
import Point from '../views/point.vue'
import Login from '../views/login.vue'
import Information from '../views/information'
// 框架应用路由
Vue.use(VueRouter);

// 配置路由（也就是配置url访问地址）
const routes = [{
  // 登陆页面
  path: '/',
  name: 'login',
  meta: {
    title: 'Login',
    navShow: false
  },
  // 首页组件文件（写首页组件对象）
  component: Login
}, {
  // 首页页面
  path: '/index',
  name: 'index',
  meta: {
    title: 'Index',
    navShow: true
  },
  // 首页组件文件（写首页组件对象）
  component: Index
}, {
  path: '/home',
  name: 'home',
  meta: {
    title: 'Home',
    navShow: true
  },
  component: Home,
}, {
  name: "detail",
  path: '/detail/:hid',
  component: Detail,
  meta: {
    title: 'detail',
    navShow: true

  }
}, {
  path: '/say',
  name: 'say',
  meta: {
    title: 'Say',
    navShow: true
  },
  component: Say
}, {
  path: '/my',
  name: 'my',
  meta: {
    title: 'My',
    navShow: true

  },
  component: My
}, {
  path: '/point',
  name: 'point',
  meta: {
    title: 'Point',
    navShow: false
  },
  component: Point
}, {
  path: '/information',
  name: 'information',
  meta: {
    title: 'Information',
    navShow: false
  },
  component: Information
}];

// 实例化路由VueRouter，得到路由对象router
// const router = new VueRouter({
//     routes
// });
const router = new VueRouter({
  linkExactActiveClass: 'nav_active',
  routes,
  // routes: routes
  // mode: 'history'

});

// 默认输出路由对象router（只输出一次）
export default router;